﻿<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>天截选课系统</title>
    <link rel="stylesheet" href="assets/plugins/element-ui/index.css" />

	<link href="assets/css/Icons.css" rel="stylesheet">
	<link rel="stylesheet" href="assets/materialize/css/materialize.min.css" media="screen,projection" />
    <!-- Bootstrap Styles-->
    <link href="assets/css/bootstrap.css" rel="stylesheet" />
    <!-- FontAwesome Styles-->
    <link href="assets/css/font-awesome.css" rel="stylesheet" />
    <!-- Morris Chart Styles-->
<!--    <link href="assets/js/morris/morris-0.4.3.min.css" rel="stylesheet" />-->
    <!-- Custom Styles-->
    <link href="assets/css/custom-styles.css" rel="stylesheet" />
    <!-- Google Fonts-->
    <link href='assets/css/Sans.css' rel='stylesheet' type='text/css' />
<!--    <link rel="stylesheet" href="assets/js/Lightweight-Chart/css教师管理.css"> -->
</head>
<body>
    <div id="wrapper">
        <nav class="navbar navbar-default top-navbar" role="navigation">
            <div class="navbar-header">
                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".sidebar-collapse">
                    <span class="sr-only">Toggle navigation</span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
                <a class="navbar-brand waves-effect waves-dark" href="index.html"><i class="large material-icons">insert_chart</i> <strong>选课系统</strong></a>
				
		<div id="sideNav" class="waves-effect waves-dark" href=""><i class="material-icons dp48">toc</i></div>
            </div>

            <ul class="nav navbar-top-links navbar-right">
                <!--铃铛，配合logoujs就可以每个页面-->
                <li id="badge" v-show="rolee==1">
                    <a class="waves-effect waves-dark" href="message.html" data-activates="dropdown2">
                        <el-badge :value="number" :max="99" class="item" style="margin-right: 20px;">
                            <i class="fa fa-bell fa-fw"></i>
                        </el-badge>
                    </a>
                </li>
				<li><a class="dropdown-button waves-effect waves-dark" href="#!" data-activates="dropdown1"><i class="fa fa-user fa-fw"></i> <b id="user-name">John Doe</b> <i class="material-icons right">arrow_drop_down</i></a></li>
            </ul>
        </nav>
		<!-- Dropdown Structure -->
<ul id="dropdown1" class="dropdown-content">
    <li><a href="user-message.html"><i class="fa fa-user fa-fw"></i> 个人信息</a></li>
    <li id="logout"><a href="#"><i class="fa fa-sign-out fa-fw"></i> 退出</a></li>
</ul>
        <div class="navbar-default navbar-side" role="navigation" id="navwapper">
            <div class="sidebar-collapse">
                <ul class="nav" id="main-menu">

                    <li>
                        <a class="waves-effect waves-dark" href="index.html"><i class="fa fa-dashboard"></i> 首页</a>
                    </li>
                    <li v-if="rolee == 2 || rolee == 0">
                        <a href="chart.html" class="active-menu waves-effect waves-dark"><i class="fa fa-bar-chart-o"></i> 教师管理</a>
                    </li>
                    <li v-if="rolee == 2 || rolee == 0">
                        <a href="tab-panel.html" class="waves-effect waves-dark"><i class="fa fa-qrcode"></i> 学生管理</a>
                    </li>

                    <li v-if="rolee == 2 || rolee == 0">
                        <a href="table.html" class="waves-effect waves-dark"><i class="fa fa-table"></i> 课程管理</a>
                    </li>
                    <li v-if="rolee == 1">
                        <a href="empty.html" class="waves-effect waves-dark"><i class="fa fa-fw fa-file"></i>学生选课</a>
                    </li>
                </ul>

            </div>

        </div>
        <!-- /. NAV SIDE  -->
        <div id="page-wrapper">
		  <div class="header"> 
                        <h1 class="page-header">
                             教师管理 
                        </h1>
						<ol class="breadcrumb">
					  <li><a href="#">Home</a></li>
					  <li><a href="#">教师管理</a></li>
					  <li class="active">Data</li>
					</ol> 
									
		</div>

            <div id="page-inner">

                <div class="row">
                    <div class="col-md-12">
                        <!-- Advanced Tables -->
                        <div class="card">
                            <div class="card-content">

                                <div style="display: flex">
                                    <label style="margin-left: 40px;margin-right: 100px;margin-bottom: 30px">教师编号：<input id="teacherId" type="text" class="validate"></label>
                                    <label>教师姓名：<input id="teacherName" type="text" class="validate"></label>
                                    <button id="teacherSearch" type="button" class="btn btn-warning" style="margin-left: 40px;">搜索</button>
                                    <button @click="toAdd()" type="button" class="btn btn-warning" style="margin-left: 100px;">添加教师</button>

                                    <form id="fileForm" action="/teacher/import" method="post" enctype="multipart/form-data">
                                        <div class="col-md-3 ">
                                            <input type="file" name="file" id='i-file'  accept=".xls, .xlsx" @input="importData()" style="display: none">
                                            <input type="button" id="i-check" value="导入教师信息" class="btn btn-primary" onclick="$('#i-file').click();">
                                        </div>
                                    </form>

                                </div>
                                <div class="table-responsive">
                                    <table class="table table-striped table-bordered table-hover" id="dataTables-example">
                                        <thead>
                                        <tr>
                                            <th class="center" width="10%">教师工号</th>
                                            <th class="center"width="8%">教师姓名</th>
                                            <th class="center" width="5%">教师性别</th>
                                            <th class="center" width="5%">教师工资</th>
                                            <th class="center" width="10%">电话号码</th>
                                            <th class="center" width="20%">所授课程</th>
                                            <th class="center" width="10%" v-if="rolee == 2">操作</th>
                                        </tr>
                                        </thead>
                                        <tbody id="tbody">
                                        <tr class="odd gradeX" v-for="(item,index) in list">
                                            <td class='cId'>{{item.teacherId}}</td>
                                            <td>{{item.teacherName}}</td>
                                            <td class="center" v-if="item.sex==1">男</td>
                                            <td class="center" v-else>女</td>
                                            <td class="center">{{item.salary}}</td>
                                            <td class="center">{{item.phone}}</td>
                                            <td class="center" v-if="item.courseName">{{item.courseName}}</td>
                                            <td class="center" v-else style="color: #31B0D5">暂未给当前老师安排课程！</td>
                                            <td class="center" v-if="rolee == 2">
                                                <button type="button" @click="toUpdate(item.teacherId)" class="btn btn-info" id="update">修改</button>
                                                <button @click="deleteTeacher(item.id)"type="button" class="btn btn-danger">删除</button>
                                            </td>
                                        </tr>
                                        </tbody>
                                    </table>
                                </div>
                                <div id="tableFooter" style="border:3px;display: flex;">

                                    <div style="margin: 0px auto;">
                                        <a href="#" id="homePage" style="text-decoration: none;">首页</a>
                                        <a href="#" id="prev" style="text-decoration: none;">&nbsp;<&nbsp; </a>
                                        <span id="current"> &nbsp;1&nbsp; </span>
                                        <a href="#" id="next" style="text-decoration: none;"> &nbsp;>&nbsp; </a>
                                        <a href="#" id="backPage" style="text-decoration: none;margin-right: 50px">尾页</a>
                                        <span>总共<span id="lastPage"></span>页</span>
                                    </div>

                                    <div style="width: 200px;">
                                        跳转至&nbsp;&nbsp;<input type="text" name="page" id="page" style="width: 30px;">&nbsp;&nbsp;页
                                        <button type="button" class="btn btn-warning" @click="jump()" >跳转</button>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <!--End Advanced Tables -->
                    </div>
                </div>
            </div>

				</div>
             <!-- /. PAGE INNER  -->
            </div>
         <!-- /. PAGE WRAPPER  -->
        </div>
    <script src="assets/js/jquery-1.10.2.js"></script>
    <script src="assets/js/vue.js"></script>
    <script src="assets/plugins/element-ui/index.js"></script>
	
	<!-- Bootstrap Js -->
    <script src="assets/js/bootstrap.min.js"></script>
	
	<script src="assets/materialize/js/materialize.min.js"></script>
	
    <!-- Metis Menu Js -->
    <script src="assets/js/jquery.metisMenu.js"></script>
    <script src="assets/js/teacher.js"></script>
    <script src="assets/js/logout.js"></script>

</body>

</html>
